import { useState } from "react";
import { useSubscribe } from "../eventBus";
//dom锁
export default function () {
  const [lockInfo, setLockInfo] = useState({
    spinning: false,
  });
  useSubscribe("screen.lock", (data) => {
    if (typeof data === "object") {
      setLockInfo(data);
    } else {
      setLockInfo({
        spinning: data,
      });
    }
  });

  return lockInfo;
}
